//
//  YYStateMachine.h
//  LearnObjectiveC
//
//  Created by client on 2017/9/18.
//  Copyright © 2017年 吴可高. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YYStateMachineTypedefiner.h"
#import "YYStateMachineMacro.h"

@class YYEvent;
@interface YYStateMachine : NSObject
@property (nonatomic, strong, readonly) NSSet *states;
@property (nonatomic, strong, readonly) NSSet *events;
@property (nonatomic, strong) NSString *initialState;

-(void)addState:(NSString*)state;
-(void)when:(NSString*)eventName transitionForm:(NSString*)from to:(NSString*)to;
-(YYEvent*)eventWithName:(NSString*)name;

-(void)before:(NSString*)eventName do:(YYStateMachineTransitionCallback)callback;
-(void)after:(NSString *)eventName do:(YYStateMachineTransitionCallback)callback;

-(NSString*)nextStateFrom:(NSString*)from forEvent:(NSString*)eventName;

@end
